
<template>
  <div>
    <div class="hang1">
      <img src="../../../public/img/1.png" alt width="100%" />
      <van-tabs class="zs">
        <van-tab v-for="item in list1" :key="item.id" :title="item.catename"></van-tab>
      </van-tabs>
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item v-for="item in list2" :key="item.id">
          <img src="../../../public/img/2.png" alt height="200px" />
        </van-swipe-item>
      </van-swipe>
      <img src="../../../public/img/4.png" alt width="100%" />
      <img src="../../../public/img/微信图片_20221222192120.png" alt width="100%" />
    </div>
  </div>
</template>
<script>
export default {
  name: "homeIndex",
  data() {
    return {
      list1: [],
      list2: [],
      list3: [],
    };
  },
  created() {
    this.getList1();
    this.getList2();
    this.getList3();
  },
  mounted() {},
  methods: {
    async getList1() {
      let res = await this.$http.get("/getcate");
      let { data } = res.data;
      this.list1 = res.data.list;
    },
    async getList2() {
      let res = await this.$http.get("/getbanner");
      let { data } = res.data;
      this.list2 = res.data.list;
    },
    async getList3() {
      let res = await this.$http.get("/getseckill");
      console.log(res);
    },
  },
};
</script>
<style>
.zs {
  width: 100%;
}
</style>